import { Component, OnInit, Input, ContentChild, TemplateRef, AfterViewInit, Output, EventEmitter } from '@angular/core';
import { BaseComponent } from '../base/base.component';

declare var $:any

@Component({
  selector: 'app-zs-modal',
  templateUrl: './zs-modal.component.html',
  styleUrls: ['./zs-modal.component.css']
})
export class ZsModalComponent extends BaseComponent implements OnInit, AfterViewInit {
  @Input() modal: any = {
    id: "",
    title: "默认标题",
    width: ''
  }
  @ContentChild("tmpl") tmpl: TemplateRef<any>
  @ContentChild("footer") footer: TemplateRef<any>
  @Output() closeEmt = new EventEmitter<any>()
  ngOnInit() {
  }
  ngAfterViewInit(): void {
    // setTimeout(() => {
    //   $(`#${this.modal.id}`).on("hide.bs.modal", () => {
    //     this.closeEmt.emit()
    //   })
    // }, 0)
  }
  back(){
    super.back()
    this.closeEmt.emit()
  }
}
